/*
 * Amazon Ads API - Sponsored Products
 * Use the Amazon Ads API for Sponsored Products for campaign, ad group, keyword, negative keyword, and product ad management operations. For more information about Sponsored Products, see the [Sponsored Products Support Center](https://advertising.amazon.com/help?entityId=ENTITY3CWETCZD9HEG2#GWGFKPEWVWG2CLUJ). For onboarding information, see the [account setup](setting-up/account-setup) topic.<br/><br/> 
 *
 * The version of the OpenAPI document: 2.0
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package org.openapitools.client.model;

import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.openapitools.client.model.BiddingAdjustments;

/**
 * Specifies bidding controls.
 */
@ApiModel(description = "Specifies bidding controls.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2022-04-12T19:05:39.971406+08:00[Asia/Shanghai]")
public class Bidding {
  /**
   * The bidding strategy. | Value | Strategy name | Description | |----------------|---------------|-------------| | &#x60;legacyForSales&#x60; | Dynamic bids - down only | Lowers your bids in real time when your ad may be less likely to convert to a sale. Campaigns created before the release of the bidding controls feature used this setting by default. | | &#x60;autoForSales&#x60; | Dynamic bids - up and down | Increases or decreases your bids in real time by a maximum of 100%. With this setting bids increase when your ad is more likely to convert to a sale, and bids decrease when less likely to convert to a sale. | | &#x60;manual&#x60; | Fixed bid | Uses your exact bid and any placement adjustments you set, and is not subject to dynamic bidding. |
   */
  @JsonAdapter(StrategyEnum.Adapter.class)
  public enum StrategyEnum {
    LEGACYFORSALES("legacyForSales"),
    
    AUTOFORSALES("autoForSales"),
    
    MANUAL("manual");

    private String value;

    StrategyEnum(String value) {
      this.value = value;
    }

    public String getValue() {
      return value;
    }

    @Override
    public String toString() {
      return String.valueOf(value);
    }

    public static StrategyEnum fromValue(String value) {
      for (StrategyEnum b : StrategyEnum.values()) {
        if (b.value.equals(value)) {
          return b;
        }
      }
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }

    public static class Adapter extends TypeAdapter<StrategyEnum> {
      @Override
      public void write(final JsonWriter jsonWriter, final StrategyEnum enumeration) throws IOException {
        jsonWriter.value(enumeration.getValue());
      }

      @Override
      public StrategyEnum read(final JsonReader jsonReader) throws IOException {
        String value =  jsonReader.nextString();
        return StrategyEnum.fromValue(value);
      }
    }
  }

  public static final String SERIALIZED_NAME_STRATEGY = "strategy";
  @SerializedName(SERIALIZED_NAME_STRATEGY)
  private StrategyEnum strategy;

  public static final String SERIALIZED_NAME_ADJUSTMENTS = "adjustments";
  @SerializedName(SERIALIZED_NAME_ADJUSTMENTS)
  private List<BiddingAdjustments> adjustments = null;


  public Bidding strategy(StrategyEnum strategy) {
    
    this.strategy = strategy;
    return this;
  }

   /**
   * The bidding strategy. | Value | Strategy name | Description | |----------------|---------------|-------------| | &#x60;legacyForSales&#x60; | Dynamic bids - down only | Lowers your bids in real time when your ad may be less likely to convert to a sale. Campaigns created before the release of the bidding controls feature used this setting by default. | | &#x60;autoForSales&#x60; | Dynamic bids - up and down | Increases or decreases your bids in real time by a maximum of 100%. With this setting bids increase when your ad is more likely to convert to a sale, and bids decrease when less likely to convert to a sale. | | &#x60;manual&#x60; | Fixed bid | Uses your exact bid and any placement adjustments you set, and is not subject to dynamic bidding. |
   * @return strategy
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The bidding strategy. | Value | Strategy name | Description | |----------------|---------------|-------------| | `legacyForSales` | Dynamic bids - down only | Lowers your bids in real time when your ad may be less likely to convert to a sale. Campaigns created before the release of the bidding controls feature used this setting by default. | | `autoForSales` | Dynamic bids - up and down | Increases or decreases your bids in real time by a maximum of 100%. With this setting bids increase when your ad is more likely to convert to a sale, and bids decrease when less likely to convert to a sale. | | `manual` | Fixed bid | Uses your exact bid and any placement adjustments you set, and is not subject to dynamic bidding. |")

  public StrategyEnum getStrategy() {
    return strategy;
  }


  public void setStrategy(StrategyEnum strategy) {
    this.strategy = strategy;
  }


  public Bidding adjustments(List<BiddingAdjustments> adjustments) {
    
    this.adjustments = adjustments;
    return this;
  }

  public Bidding addAdjustmentsItem(BiddingAdjustments adjustmentsItem) {
    if (this.adjustments == null) {
      this.adjustments = new ArrayList<BiddingAdjustments>();
    }
    this.adjustments.add(adjustmentsItem);
    return this;
  }

   /**
   * Get adjustments
   * @return adjustments
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public List<BiddingAdjustments> getAdjustments() {
    return adjustments;
  }


  public void setAdjustments(List<BiddingAdjustments> adjustments) {
    this.adjustments = adjustments;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    Bidding bidding = (Bidding) o;
    return Objects.equals(this.strategy, bidding.strategy) &&
        Objects.equals(this.adjustments, bidding.adjustments);
  }

  @Override
  public int hashCode() {
    return Objects.hash(strategy, adjustments);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class Bidding {\n");
    sb.append("    strategy: ").append(toIndentedString(strategy)).append("\n");
    sb.append("    adjustments: ").append(toIndentedString(adjustments)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

}

